home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / 4dostool / tfc22c.zip / TFC.BTM < prev   
Text File  |  1994-01-11  |  12KB  |  325 lines

  1. loadbtm on
  2. @echo off
  3. REM =========================================================================
  4. REM
  5. REM  TFC Tobi's Floppy Cataloguer Version 2.2c 1-11-94, 8:38 PM
  6. REM
  7. REM       This program is released into the Public Domain
  8. REM       Feel free to make changes to this program but
  9. REM       don't Remove my name and address ...
  10. REM       Let me know if you have any enhancements or if
  11. REM       you find errors ...
  12. REM       
  13. REM       New in Version 2.2c:     
  14. REM               . Workaround for Escape Bug in 4dos 5.0c
  15. REM                 (Thanks  Ilkka Puranen  2:221/360.26) 
  16. REM 
  17. REM       New in Version 2.2b:
  18. REM               . 'Drive B: bug' fixed
  19. REM
  20. REM       New in Version 2.2:
  21. REM               . Allow removal Catalogue Entries
  22. REM               . Added Quit Option, when Scanning Disks without
  23. REM                 descriptions
  24. REM               . Write Free Space on Floppy to the database
  25. REM               . Corrected Handling of 0 Size PROG.TFC
  26. REM
  27. REM       New in Version 2.1:
  28. REM               . Minor Error Corrections
  29. REM               . Corrected Problems with Disklables containing a Space
  30. REM
  31. REM       New in Version 2:
  32. REM               . Checks if there is a Disklabel
  33. REM               . Checks if there is a Description for each File
  34. REM               . Always saves the Database to a file called PROGS.TFC
  35. REM                 in the same dir as TFC.BTM is located
  36. REM               . Uses TCV /GREP to Remove old Disks from Progs.TFC
  37. REM               . besides the entry for each file on the floppy there is
  38. REM                 always added a line containing DISK SIZE and USED space
  39. REM                 to the catalogue.
  40. REM               . Can also add Disks without Descriptions to the Archive,
  41. REM                 just stating Label,Used Disk Space,Data of Last Modified 
  42. REM                 File, <40 Chars of Description and the Scan Date.
  43. REM
  44. REM
  45. REM        Thanks for Additions and Corrections to:
  46. REM
  47. REM               . David Frey (no e-Mail)
  48. REM               . Thomas Ludwig (ludwig@informatik.tu-muenchen.de)
  49. REM               . Maettu Studer (no e-Mail)
  50. REM
  51. REM
  52. REM        Written by
  53. REM               Tobi Oetiker (oetiker@stud.ee.ethz.ch or 2:301/516.2@fido)
  54. REM               Gallusstrasse 25 / CH-4600 Olten / FAX +41 62 32 61
  55. REM
  56. REM
  57. REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  58.  
  59.  
  60. REM =========================================================================
  61. REM ::::::::::: Test if the correct Version of 4Dos is in the System ::::::::
  62. REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  63.  
  64. IFF "%_4VER" LT "4.0" THEN
  65.   BEEP
  66.   TEXT
  67.  
  68.   ** ERROR: Sorry but TFC needs 4DOS 4.x to run :-(
  69.             You can get the newest Version from Simtel via FTP or
  70.             order it from a shareware distributor.
  71.  
  72.  
  73.   ENDTEXT
  74.   QUIT
  75. ENDIFF
  76.  
  77. REM =========================================================================
  78. REM ::::::::::: Give advice to the novice User ::::::::::::::::::::::::::::::
  79. REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  80.  
  81. SETLOCAL
  82. UNALIAS *
  83. IFF %@UPPER[%1]x NE A:x .AND. %@UPPER[%1]x NE B:x .AND. "%@SUBSTR[%1,1,%@EVAL[%@LEN[%1]-2]]"x NE %1x THEN
  84. TEXT
  85. TFC - Tobi's Floppy Cataloguer Version 2.2 - 10-27-93, 5:34 PM
  86.  
  87. TFC helps you to keep organized all these Floppy Disks where you store
  88. your PD and Shareware. 
  89.  It creates and maintains a comma delimited database called PROGS.TFC
  90. containing information about the files on the Floppies you scan, including
  91. the 4DOS-Description of each File.
  92.  The database can now be either viewed and searched with TCV, which comes 
  93. with TFC or it can be imported into Programs like Paradox or dBase.    
  94.  
  95. Usage:   TFC drive | "label"
  96.  
  97.           drive    is the disk drive you want to scan from
  98.           label    is a Floppy-Disk Label you want to remove from the catalogue
  99.           
  100. Example: tfc a: ------------->  scan drive a:
  101.          tfc "games 8" ------>  remove the catalogue entries for the "games 8"
  102.                                 Floppy
  103.  
  104. Written by Tobi Oetiker (oetiker@stud.ee.ethz.ch or 2:301/516.4@fidonet)
  105.            Gallusstrasse 25 / CH-4600 Olten / FAX +41 62 32 61
  106. ENDTEXT
  107.   GOTO ERREXIT
  108. ENDIFF
  109.  
  110. REM =========================================================================
  111. REM ::::::::::: Test if there is enough Environement space for TFC.BTM ::::::
  112. REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  113.  
  114. IFF %_ENV LT 180 THEN
  115.   BEEP
  116.   TEXT
  117.  
  118. ** ABORTED ... you need at least 180 byte of free environment space
  119.                after TFC is started ... Either use
  120.  
  121.                   set var=
  122.  
  123.                to make space or rise the environment value in your
  124.                4dos.ini file.
  125.  
  126.                * var stands for any environment variable. You get a list
  127.                  of your variables if you type set at the command prompt.
  128.                  Using the command "memory" you can check how much space is
  129.                  left ...
  130.  
  131.   ENDTEXT
  132.   goto errexit
  133. ENDIFF
  134.  
  135. REM =========================================================================
  136. REM ::::::::::: Setup Path for PROGS.TFC file :::::::::::::::::::::::::::::::
  137. REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  138.  
  139. SET target=%@SEARCH[%0]
  140. IF "%target" EQ "" SET target=%@FULL[%0]
  141. SET target=%@PATH[%target]progs.tfc
  142.  
  143. REM =========================================================================
  144. REM ::::::::::: Setup TEMP file :::::::::::::::::::::::::::::::::::::::::::::
  145. REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  146.  
  147. SET temp=%@UNIQUE[%@PATH[%target]]
  148.  
  149. ECHO.
  150. ECHO TFC - Tobi's Floppy Cataloguer Version 2.2 - A 4DOS BTM File
  151. ECHO.
  152.  
  153. REM =========================================================================
  154. REM ::::::::::: Is it a Removal Session ??? :::::::::::::::::::::::::::::::::
  155. REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  156.  
  157. IFF "%@substr[%1,1,%@eval[%@len[%1]-2]]" eq %1 then
  158.   SET dsklbl=%@LOWER[%1]
  159.   GOSUB REMOVAL
  160.   echo.
  161.   GOTO NORMENDE
  162. ENDIFF
  163.  
  164. REM =========================================================================
  165. REM ::::::::::: Wait for Floppy to be inserted into Drive :::::::::::::::::::
  166. REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  167. SET t=j
  168. :again
  169. IFF %@READY[%1] EQ 0 THEN
  170.  SET t=
  171.  ECHOS %@CHAR[13]=:- please INSERT next disk ... or press any key to EXIT               %@char[255]
  172.  INKEY /W1 %%t
  173.  IF "%t" NE "" GOTO normende
  174. ELSE
  175.  GOTO read
  176. ENDIFF
  177.  
  178. GOTO again
  179.  
  180. REM =========================================================================
  181. REM ::::::::::: Has this Floppy a electronic label attached ? :::::::::::::::
  182. REM ::::::::::: If not, ask user to Provide One ! :::::::::::::::::::::::::::
  183. REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  184.  
  185. :read
  186.  
  187. IFF "%@LABEL[%1]" EQ "unlabeled" THEN
  188.  BEEP
  189.  ECHO %@CHAR[13]** ERROR                                                   %@CHAR[255]
  190.  LABEL %1
  191.  ECHO.
  192.  ECHO.
  193. ENDIFF
  194.  
  195. REM =========================================================================
  196. REM ::::::::::: Scan existing PROGS.TFC file for entries about ::::::::::::::
  197. REM ::::::::::: the Floppy now being processed and remove them ::::::::::::::
  198. REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  199.  
  200. SET dsklbl="%@LABEL[%1]"
  201. GOSUB REMOVAL
  202.  
  203. REM =========================================================================
  204. REM :::::::: Look if there are no files with description on the floppy ::::::
  205. REM :::::::: and offer appropriate action to be taken :::::::::::::::::::::::
  206. REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  207.  
  208. IFF NOT EXIST %1descript.ion THEN
  209.   ECHO %@CHAR[13]** HEY there are no files with Description on this Disk ...             %@CHAR[255]
  210.   TEXT
  211.  
  212. Press  [L] : To add only the LABEL of the Disk plus 40 Chars of Description
  213.              to the PROGS.TFC File.
  214.        [D] : To describe each File on the Disk and add t